// 事物类
export class Food {
	element: HTMLElement;
	width: number = 10;
	height: number = 10;
	constructor() {
		this.element = document.getElementById('food') as HTMLElement;
		this.change()
	}

	get X() {
		return this.element.offsetLeft
	}
	get Y() {
		return this.element.offsetTop
	}
	change(X:number = 29 ,Y:number = 29 ) {
		let x = Math.round(Math.random() * X) * 10;
		let y = Math.round(Math.random() * Y) * 10;
		console.log(x,y)
		this.element.style.left = x + "px";
		this.element.style.top = y + "px";
	}
}

export default Food
// 记分牌


